package com.syni.mdd.yhd.common.all.dao.jpa;

import com.syni.mdd.yhd.common.all.dao.BaseJPADao;
import com.syni.mdd.yhd.common.all.entity.BmsUserOperationLog;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Map;

public interface BmsUserOperationLogDao extends BaseJPADao<BmsUserOperationLog,Integer> {

    @Query(value = "select count(*) num,buol.video_id from bms_user_operation_log buol where buol.operation_type = ?1" +
            " and buol.operation_time >= str_to_date(?2,\'%Y%m%d%H%i%s\') and buol.operation_time < str_to_date(?3,\'%Y%m%d%H%i%s\') group by buol.video_id ",nativeQuery = true)
    List<Map<String,Object>> countVideoPlayNum(Integer operationType, String startTime, String endTime);
}
